package com.bdqn.ch03.SL;

import com.bdqn.ch03.pojo.IntermediaryJdkProxyFactory;
import com.bdqn.ch03.service.Buyer;
import com.bdqn.ch03.service.impl.RealBuyer;
import org.apache.log4j.Logger;

/**
 * IntermediaryJdkProxyFactoryTest
 *示例 8 使用JDK 动态代理方式实现房产中介对买家代理效果
 * @aurhor Administrator  whs
 * @since 2024/7/1
 */
public class IntermediaryJdkProxyFactoryTest {
    private static Logger logger = Logger.getLogger(IntermediaryJdkProxyFactoryTest.class);

    public static void main(String[] args) {
        Buyer buyer = IntermediaryJdkProxyFactory.create(new RealBuyer());
        String result = buyer.havealook();
        logger.info(result);
        /**
         * 2024-07-01 19:58:19 [DEBUG] 前期准备。 com.bdqn.ch03.SL.IntermediaryInvocationHandler.before(IntermediaryInvocationHandler.java:45)
         * 2024-07-01 19:58:19 [DEBUG] 查找房源。 com.bdqn.ch03.SL.IntermediaryInvocationHandler.before(IntermediaryInvocationHandler.java:46)
         * 2024-07-01 19:58:19 [DEBUG] 和卖家沟通时间。 com.bdqn.ch03.SL.IntermediaryInvocationHandler.before(IntermediaryInvocationHandler.java:47)
         * 2024-07-01 19:58:19 [DEBUG] 实地查看一下 com.bdqn.ch03.service.impl.RealBuyer.havealook(RealBuyer.java:22)
         * 2024-07-01 19:58:19 [DEBUG] 后期跟踪。 com.bdqn.ch03.SL.IntermediaryInvocationHandler.after(IntermediaryInvocationHandler.java:50)
         * 2024-07-01 19:58:19 [DEBUG] 和买家沟通意见。 com.bdqn.ch03.SL.IntermediaryInvocationHandler.after(IntermediaryInvocationHandler.java:51)
         * 2024-07-01 19:58:19 [ INFO] 看房记录：买家反馈“一些意见” com.bdqn.ch03.SL.IntermediaryJdkProxyFactoryTest.main(IntermediaryJdkProxyFactoryTest.java:20)
         */
    }
}
